<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.tueye.entity.Topics"%>
<%@ taglib prefix="c"       uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/common/include.jsp" %>
<%@ page isELIgnored="false"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 
%>
 
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
     <meta http-equiv="content-Type" content="text/html; charset=utf-8" />
    <title>用户收藏作品</title>
	<meta http-equiv="pragma" content="no-cache" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="expires" content="0" />    
	<meta http-equiv="keywords" content="blog,图片,david" />
	<meta http-equiv="description" content="This is my web blog" />
	 
<link href="<%=path %>/themes/css/index.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/themes/css/pmanager.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript" src="<%=path %>/script/jquery.js"></script>
 
<style type="text/css">
 
* {   
    font-size:12px   
}   
table {   
    border-collapse:collapse;   
    width:90%;   
    border:1px solid #7A90A8;   
    border-top:3px;   
    margin-left:15px;   
}   
td {   
padding-left:3px;   
text-align:left;   
}   
.tr_head td{   
background:#FFA238;   
height:17px;   
font-weight:600;   
padding-left:4px;   
color:#FFF;   
}   
.rowA{ background-color:#F6F5F0;}   
.rowB{ background-color:#F0F0EA;}   
.tdBody{ background-color:#FFF;text-align:center;}   
.tdPage{ background-color:#FFA238; text-align:right; padding-right:20px; cursor:pointer; }   
 td a{
  color:#6666CC; text-decoration:none;
 }
 td a:hover{
background:#6666CC none repeat scroll 0 0;color:#FFFFFF;padding:3px 1px 0;}

</style>
<script type="text/javascript">
  function del_submit(id){ 
     if (confirm('确定删除该收藏吗？')==false) return; 
     var tr =$('#'+id).parent().parent();
     var sendData="del_id="+id;
     $.ajax({
            type:"POST",
            url: "<%=request.getContextPath()%>/delcollect.do", 
            dataType:'html', //接受数据格式
            async: false,
            data: sendData,

            success: function(data){ 
            tr.remove();
                   
                },
           error:function(data){
             alert(data);
           }
            }) 
     
}
</script>
</head> 
<body>
<%@ include file="../../../../common/header.jsp"%>
<div id="container">
<div id="mainbody">
  <div id="managerleftbody">
     <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我的设置</h2>
	  <ul>
	    <li class="lefttitle">信息设置</li>
	   <li> <a href="<%=request.getContextPath()%>/userinfoset.do">基本信息 </a></li>
	   <li><a href="<%=request.getContextPath()%>/pages/topics/usermanager/updateUserface.jsp">更换头像</a></li>
	   <li><a href="<%=request.getContextPath()%>/moreUserinfo.do">详细信息</a></li>
		 <li><a href="<%=request.getContextPath()%>/useraccount.do">帐户设置</a></li> 
	  </ul>
	  
	  <ul>
	    <li class="lefttitle">作品管理</li>
	   <li><a href="<%=request.getContextPath()%>/usertopicmanager.do">发布的作品</a></li>
	   <li>收藏的作品</li>
	   <li><a href="<%=request.getContextPath()%>/usercomment.do">评论的作品</a></li> 
	  </ul>
	   <ul>
	    <li class="lefttitle">站内动态</li>
	   <li><a href="javascript:alert('功能暂未启用')">全站动态</a></li>
		 <li><a href="javascript:alert('功能暂未启用')">我的好友</a></li>
	   <li><a href="javascript:alert('功能暂未启用')">好友动态</a></li>
	    
	  </ul>
  </div>
   <div id="managerrightbody">
	   <div class="ClassTitle">用户收藏</div>
 <table border="1" align="center">  
  <tr class="tr_head" >  
    <td width="70%">收藏作品名称</td>  
     
    <td width="30%">操作</td>  
  </tr>  
  <c:if test="${!empty pm.datas}">
		     <c:forEach items="${pm.datas }" var="topic">
				<tr><td> 
				<a href="<%=path %>/pages/topics/${topic.topic_type.type_enlish_name }/${topic.id}" target="_blank">
				${topic.topic_title }</a><td>
				<input type="button"  id="${topic.id}" value="删除" onClick="del_submit('${topic.id}');"/>
				 </td>
 </tr>
			</c:forEach>
	 </c:if>
	   <c:if test="${empty pm.datas}"> 
				 <td colspan="4" height="130px" class="tdBody">您还没有收藏作品！</td>   
	 </c:if>
  <tr>  
    <td colspan="2" height="20px" class="tdPage">
     <pg:pager items="${pm.total}" url="usercollect.do" export="currentPageNumber=pageNumber" maxIndexPages="10" maxPageItems="9" >
				<pg:first><a href="${pageUrl}">首页</a></pg:first>
				<pg:prev><a href="${pageUrl }">前页</a></pg:prev>
				<pg:pages>
					<c:choose>
					<c:when test="${ currentPageNumber eq pageNumber}">
					<font color="red">${pageNumber}</font>
					</c:when>
					<c:otherwise>
					<a href="${pageUrl }">${pageNumber }</a>
					</c:otherwise>
					</c:choose>
				</pg:pages>
				<pg:next><a href="${pageUrl }">下页</a></pg:next>
				<pg:last><a href="${pageUrl }">尾页</a></pg:last>
			</pg:pager>   </td>  
  </tr>  
</table>  
	     
	</div>
 </div> </div>
<%@ include file="../../../../common/footer.jsp" %>

</body>
</html>

